import { Component } from 'react'



class MySixx extends Component {
  state = {
    count: 0,
    obj: {
      name: '哈哈',
      age: 20
    },
    list: [1, 2, 3]
  }

  

  handleClick = () => {
    let newObj = {
      ...this.state.obj,
      age: 30
    }
    this.setState({
      count: 10,
      obj:newObj
    })
  }

  render () {
    return <div>
      <h3>我是类组件</h3>
      <ul>
        <li>{this.state.count}</li>
        <li>{this.state.obj.age}</li>
        <li onClick={this.handleClick}>修改</li>
        <li></li>
        <li></li>
      </ul>
      </div>
  }
}

export default MySixx